package com.guli.search.controller;

import com.guli.common.to.esmodel.SkuEsModel;
import com.guli.common.utils.R;
import com.guli.search.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("/index/data")
public class IndexDataController {
    @Autowired
    private IndexService indexServicel;
    /*
    * 上架商家
    * */
    @PostMapping("/product")
    public R productUp(@RequestBody List<SkuEsModel> skuEsModels) {
        boolean ifSuccess = indexServicel.productUp(skuEsModels);
        if (ifSuccess){
            return R.ok();
        }
        return R.error();
    }


}
